package me.flyray.bsin.server.config;

import org.springframework.ai.tool.ToolCallback;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.resolution.DelegatingToolCallbackResolver;
import org.springframework.ai.tool.resolution.StaticToolCallbackResolver;
import org.springframework.ai.tool.resolution.ToolCallbackResolver;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class AiMcpToolsConfig {

    @Bean
    ToolCallbackResolver toolCallbackResolver(List<ToolCallback> toolCallbacks) {
        StaticToolCallbackResolver staticToolCallbackResolver =
                new StaticToolCallbackResolver(toolCallbacks);
        return new DelegatingToolCallbackResolver(List.of(staticToolCallbackResolver));
    }

}
